#!/usr/bin/env python
# Requirement: PyYAML

import yaml
import sys

host=sys.argv[1]
new_yaml={'classes':['base'],'parameters':{'puppet_server':
'puppet.example.com'}}

if "web" in host: new_yaml['classes'].append('web')
elif "db" in host: new_yaml['classes'].append('db')
elif "mail" in host: new_yaml['classes'].append('mail')

new_yaml['parameters']['file_server']="puppet://puppet.example.com/config"

# print new_yaml
print yaml.dump(new_yaml, explicit_start=True,default_flow_style=False)

